<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>xxxxx</title>
    <!--Vue必须放上面-->
    <script src="../js/vue.js"></script>
    <!--ElementUi-->
    <script src="../element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css">
</head>
<body>
    <div id="app">
        <!--
            转换组件：el-switch   行级组件
               active-text : 激活后的文本 , 打开后对应的文本高亮显示
               inactive-text : 激活前的文本 , 关闭后对应的文本高亮显示
        -->
        <el-switch v-model="flag"></el-switch>
        <hr>
        未婚<el-switch v-model="flag"></el-switch>已婚
        <hr>
        <el-switch v-model="flag" active-text="已婚" inactive-text="未婚"></el-switch>
    </div>
    <script>
        const vm = new Vue({
            el: "#app",
            data: {
                flag:false,
            },
            methods: {}
        });
    </script>
</body>
</html>